<?php
    $sectionRepository = new SectionRepository();
    $lstSection = $sectionRepository->GetAll(); 
    $categoryRepository = new CategoryRepository();
    $accountRepository = new AccountRepository();
    $lstAccHoTro = $accountRepository->GetAccount_HoTro();
?>

<div id="left">
    <a href="../views/index.php"><img src="../content/images/Home.gif" border="0" alt="" width="222" height="58" /></a><br />
    <a href="../views/newProducts.php"><img src="../content/images/NewProducts.gif" border="0" alt="" width="222" height="34" /></a><br />
    <a href="../views/Mostsold.php"><img src="../content/images/Special.gif" border="0" alt="" width="222" height="34" /></a><br />
    <a href="../views/contact.php"><img src="../content/images/Contact.gif" border="0" alt="" width="222" height="58" /></a>
    <div class="clearall"></div>
    <table border="0" width="222" cellspacing="0" cellpadding="0" class="box_heading_table" style="margin-top:15px;">
        <tr>
            <td>
                <img src="../content/images/box_heading_tl.gif" border="0" alt="" width="10" height="10" />
            </td>
            <td width="100%" class="box_heading_tall_t">
                <img src="../content/images/spacer.gif" border="0" alt="" width="1" height="1" />
            </td>
            <td>
                <img src="../content/images/box_heading_tr.gif" border="0" alt="" width="10" height="10" />
            </td>
        </tr>
        <tr>
            <td class="box_heading_tall_l">
                <img src="../content/images/box_heading_l.gif" border="0" alt="" width="10" height="27" />
            </td>
            <td class="box_heading_td">
                DANH MỤC
            </td>
            <td class="box_heading_tall_r">
                <img src="../content/images/box_heading_r.gif" border="0" alt="" width="10" height="27" />
            </td>
        </tr>
        <tr>
            <td>
                <img src="../content/images/box_heading_bl.gif" border="0" alt="" width="10" height="10" />
            </td>
            <td class="box_heading_tall_b">
                <img src="../content/images/spacer.gif" border="0" alt="" width="1" height="1" />
            </td>
            <td>
                <img src="../content/images/box_heading_br.gif" border="0" alt="" width="10" height="10" />
            </td>
        </tr>
    </table>
    <div class="clearall"></div>
    <div class="box_body" style="float:left">
        <ul class="menu">
            <?php
                for($i = 0; $i < count($lstSection); $i++)
                {
            ?>
            <li class="bg_list"><a href="../Views/GetProductBySection.php?sectionID=<?php echo $lstSection[$i]->ID_i; ?>"><?php echo $lstSection[$i]->Name_s ?></a>
                <ul>
                    <?php
                        $lstCategory = $categoryRepository->GetCategoriesBySectionID($lstSection[$i]->ID_i);
                        for($j = 0; $j < count($lstCategory); $j++)
                        {
                    ?>
                    <li class="bg_list"><a href="../Views/GetProductByCategory.php?categoryID=<?php echo $lstCategory[$j]->ID_i; ?>"><?php echo $lstCategory[$j]->Name_s ?></a></li>
                    <?php
                        }
                    ?>
                </ul>
            </li>
            <?php
                }
            ?>

        </ul>
    </div>
    <div class="clearall"></div>
    <table border="0" width="222" cellspacing="0" cellpadding="0" class="box_heading_table" style="margin-top:15px;">
        <tr>
            <td>
                <img src="../content/images/box_heading_tl.gif" border="0" alt="" width="10" height="10" />
            </td>
            <td width="100%" class="box_heading_tall_t">
                <img src="../content/images/spacer.gif" border="0" alt="" width="1" height="1" />
            </td>
            <td>
                <img src="../content/images/box_heading_tr.gif" border="0" alt="" width="10" height="10" />
            </td>
        </tr>
        <tr>
            <td class="box_heading_tall_l">
                <img src="../content/images/box_heading_l.gif" border="0" alt="" width="10" height="27" />
            </td>
            <td class="box_heading_td">
                HỖ TRỢ
            </td>
            <td class="box_heading_tall_r">
                <img src="../content/images/box_heading_r.gif" border="0" alt="" width="10" height="27" />
            </td>
        </tr>
        <tr>
            <td>
                <img src="../content/images/box_heading_bl.gif" border="0" alt="" width="10" height="10" />
            </td>
            <td class="box_heading_tall_b">
                <img src="../content/images/spacer.gif" border="0" alt="" width="1" height="1" />
            </td>
            <td>
                <img src="../content/images/box_heading_br.gif" border="0" alt="" width="10" height="10" />
            </td>
        </tr>
    </table>
    <div class="clearall"></div>
    <div class="box_body" style="float:left;">
        <?php
            for($i = 0; $i < count($lstAccHoTro); $i++){?>
        <div style="float:left; width:125px; margin:10px 40px 0px 40px;">
            <a href="ymsgr:sendIM?<?php echo $lstAccHoTro[$i]->YahooID_s; ?>">
                <img src="http://mail.opi.yahoo.com/online?u=<?php echo $lstAccHoTro[$i]->YahooID_s; ?>&t=2" style="width:125px;height:25px" alt="" />
            </a> 
        </div>
        <div class="clearall"></div>
        <?php
            }
        ?>
    </div>
</div>